<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <script src="./lib/PromiseNew.js"></script>
</head>
<body>
<script>
    const p = new Promise((resolve,reject)=>{
        setTimeout(()=>{
            // resolve(1)
            reject(3)
            console.log('reject()改变状态后')
        },1000)

    }).then(
        value => {
            console.log('onResolved1',value)
        },
        reason => {
            console.log('onRejected1',reason)
            // throw 4
            return new Promise(((resolve, reject) => reject(10)))
        }
    ).then(
        value => {
            console.log('onResolved2',value)
        },
        reason => {
            console.log('onRejected2',reason)
        }
    ).catch(reason => {
        console.log('onRejected3',reason)
    })

// function fn(event) {
//
// }
// div.onclick=function (event) {
//     fn(event)
// }
// div.onclick=fn
</script>
</body>
</html>
